package com.weigang.jdbctemplate.service;


import com.weigang.jdbctemplate.dao.UserDao;
import com.weigang.jdbctemplate.entity.HrUser;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserService {

    @Resource
    private UserDao userDao;

    public int addUser(HrUser hrUser) {
        return userDao.addUser(hrUser);
    }

    public int updateUser(HrUser hrUser) {
        return userDao.updateUser(hrUser);
    }

    public int deleteUser(Integer id) {
        return userDao.deleteUser(id);
    }

    public HrUser getUserById(Integer id) {
        return userDao.getBookById(id);
    }

    public List<HrUser> getAllUsers() {
        return userDao.getAllBooks();
    }
}
